package com.zzx;

import com.zzx.model.Student;

public class Test3 {

	public static void main(String[] args) {
		int x = 10;
		int y = 10;
		String str1 = new String("abc");
		String str2 = new String("abc");
		System.out.println(x == y); // true
		System.out.println(str1 == str2); // false
		System.out.println(str1.equals(str2)); // true
		String s = "abc";
		String s2 = "abc";
		String s3 = new String("abc");
		
		System.out.println(s == s2); // true
		System.out.println(s.equals(s2)); // true
		System.out.println(s == s3);// false
		System.out.println(s.equals(s3)); // true
		
		String s4 = "abca";
		String s5 = "abc97";
		
		System.out.println(s4 == s5); // false
		System.out.println(s4.equals(s5)); // false
		
		char[] a = "a".toCharArray();
		System.out.println("a="+a[0]);
		
		Student student1 = new Student();
		Student student2 = new Student();
		//student1.setAge(12);
		student1.setName("张三");
		student1.setId("11");
		student1.setSex("男");
		
		student2.setSex("男");
		student2.setId("11");
		student2.setAge(0);
		student2.setName("张三");
		System.out.println(student1.getAge());
		System.out.println("对象比较:"+student1.equals(student2));
	}

}
